<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>插件的使用</title>
  <link rel="stylesheet" href="./css/swiper.min.css">
  <style>
    html,
    body {
      position: relative;
      height: 100%;
    }

    body {
      background: #eee;
      font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
      font-size: 14px;
      color: #000;
      margin: 0;
      padding: 0;
    }

    .swiper-container {
      width: 100%;
      height: 100%;
      margin-left: auto;
      margin-right: auto;
    }

    .swiper-slide {
      text-align: center;
      font-size: 18px;
      background: #fff;

      /* Center slide text vertically */
      display: -webkit-box;
      display: -ms-flexbox;
      display: -webkit-flex;
      display: flex;
      -webkit-box-pack: center;
      -ms-flex-pack: center;
      -webkit-justify-content: center;
      justify-content: center;
      -webkit-box-align: center;
      -ms-flex-align: center;
      -webkit-align-items: center;
      align-items: center;
    }

    .banner {
      width: 976px;
      height: 550px;
      background-color: pink;
      margin: 0 auto;
    }

    .swiper-pagination-bullet {
      background-color: #fff;
      opacity: 1;
    }

    .swiper-pagination-bullet-active {
      background-color: pink;
    }
  </style>

</head>

<body>
  <div class="banner">
    <div class="swiper-container">
      <div class="swiper-wrapper">
        <!-- 每个小图片模块 -->
        <div class="swiper-slide">
          <img src="./images/slider01.jpg" alt="">
        </div>
        <!-- 每个小图片模块 -->
        <div class="swiper-slide">
          <img src="./images/slider02.jpg" alt="">
        </div>
        <!-- 每个小图片模块 -->
        <div class="swiper-slide">
          <img src="./images/slider03.jpg" alt="">
        </div>
        <!-- 每个小图片模块 -->
        <div class="swiper-slide">
          <img src="./images/slider04.jpg" alt="">
        </div>
        <!-- 每个小图片模块 -->
        <div class="swiper-slide">
          <img src="./images/slider05.jpg" alt="">
        </div>
      </div>
      <!-- Add Pagination -->
      <div class="swiper-pagination"></div>
      <!-- Add Arrows -->
      <div class="swiper-button-next"></div>
      <div class="swiper-button-prev"></div>
    </div>
  </div>
  <script src="./js/swiper.min.js"></script>
  <script>
    const swiper = new Swiper('.swiper-container',{
      pagination:'.swiper-pagination', // 显示小圆点
      nextButton:'.swiper-button-next',
      prevButton:'.swiper-button-prev',
      slidesPerView:1,  // 盒子显示的图片张数
      paginationClickable:true, //点击小圆点可以切换图片
      spaceBetween:20, // 图片之间的空白缝隙
      loop:true, // 可以无缝滚动图片
      autoplay:3000 // 可选 选项 ，自动滑动，自动播放
    })
    
  </script>
</body>

</html>